package com.idanchuang.component.logback.util;

import com.idanchuang.component.logback.enums.MaskType;

import java.util.Arrays;
import java.util.List;

public class MaskKey {

    private List<String> keys;
    private MaskType maskType;

    public MaskKey() {
    }

    public MaskKey(MaskType maskType, String... keys) {
        this.keys = Arrays.asList(keys);
        this.maskType = maskType;
    }

    public static MaskKey of(MaskType maskType, String... keys) {
        return new MaskKey(maskType, keys);
    }

    public static MaskKey name(String... keys) {
        return new MaskKey(MaskType.NAME, keys);
    }

    public static MaskKey address(String... keys) {
        return new MaskKey(MaskType.ADDRESS, keys);
    }

    public static MaskKey keepHalfFront(String... keys) {
        return new MaskKey(MaskType.KEEP_HALF_FRONT, keys);
    }

    public static MaskKey keepHalfBack(String... keys) {
        return new MaskKey(MaskType.KEEP_HALF_BACK, keys);
    }

    public static MaskKey keepEndpoint(String... keys) {
        return new MaskKey(MaskType.KEEP_ENDPOINT, keys);
    }

    public static MaskKey mobile(String... keys) {
        return new MaskKey(MaskType.MOBILE, keys);
    }

    public static MaskKey password(String... keys) {
        return new MaskKey(MaskType.PASSWORD, keys);
    }

    public static MaskKey idCard(String... keys) {
        return new MaskKey(MaskType.ID_CARD, keys);
    }

    public static MaskKey email(String... keys) {
        return new MaskKey(MaskType.EMAIL, keys);
    }

    public static MaskKey bankNumber(String... keys) {
        return new MaskKey(MaskType.BANK_NUMBER, keys);
    }

    public static MaskKey akSk(String... keys) {
        return new MaskKey(MaskType.AK_SK, keys);
    }

    public List<String> getKeys() {
        return keys;
    }

    public void setKeys(List<String> keys) {
        this.keys = keys;
    }

    public MaskType getMaskType() {
        return maskType;
    }

    public void setMaskType(MaskType maskType) {
        this.maskType = maskType;
    }
}
